@echo off
echo Building Go application for Linux x86_64...
echo.

REM 设置Go交叉编译环境变量
set GOOS=linux
set GOARCH=amd64

REM 构建应用
echo Building websocket-server for Linux x86_64...
go build -o websocket-server-linux-amd64 .

REM 检查构建结果
if exist websocket-server-linux-amd64 (
    echo.
    echo Build successful!
    echo Output file: websocket-server-linux-amd64
    echo File size: 
    dir websocket-server-linux-amd64 | findstr websocket-server-linux-amd64
    echo.
    echo The executable is ready for Linux x86_64 systems.
) else (
    echo.
    echo Build failed!
    echo Please check for compilation errors.
)

echo.
pause 